<!DOCTYPE html>
<html lang="en">

	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>课程通过预警</title>

		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="/assets/css/jquery-ui.min.css" />

		<!-- text fonts -->
		<link rel="stylesheet" href="/assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="/assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="/assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="/assets/js/html5shiv.min.js"></script>
		<script src="/assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="no-skin">
		<div id="navbar" class="navbar navbar-default          ace-save-state">
			<div class="navbar-container ace-save-state" id="navbar-container">
				<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
					<span class="sr-only">Toggle sidebar</span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>
				</button>

				<div class="navbar-header pull-left">
					<a href="/views/index.html" class="navbar-brand">
						<small>
							<i class="fa fa-leaf"></i>
							学生发展数据综合评价与分析系统
						</small>
					</a>
				</div>

				<div class="navbar-buttons navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">

						<li class="light-blue dropdown-modal">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">

								<img class="nav-user-photo us_photo" src="/assets/images/avatars/blank.jpg" alt="个人头像" style="background-color:#fff" />

								<span class="user-info">
							       <span id="us_name"></span>
								</span>

								<i class="ace-icon fa fa-caret-down"></i>
							</a>

							<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li>
									<a id="setting" target="_blank">
										<i class="ace-icon fa fa-cog"></i> 设置
									</a>
								</li>

								<li>
									<a id="profile" target="_blank">
										<i class="ace-icon fa fa-user"></i> 个人信息
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="/login.html" onclick="logout()">
										<i class="ace-icon fa fa-power-off"></i> 注销
									</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
			</div>
			<!-- /.navbar-container -->
		</div>

		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try {
					ace.settings.loadState('main-container')
				} catch(e) {}
			</script>

			<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
				<script type="text/javascript">
					try {
						ace.settings.loadState('sidebar')
					} catch(e) {}
				</script>

				<div class="sidebar-shortcuts" id="sidebar-shortcuts">
					<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
						<button class="btn btn-success">
							<i class="ace-icon fa fa-signal"></i>
						</button>

						<button class="btn btn-info">
							<i class="ace-icon fa fa-pencil"></i>
						</button>

						<button class="btn btn-warning">
							<i class="ace-icon fa fa-users"></i>
						</button>

						<button class="btn btn-danger">
							<i class="ace-icon fa fa-cogs"></i>
						</button>
					</div>

					<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
						<span class="btn btn-success"></span>

						<span class="btn btn-info"></span>

						<span class="btn btn-warning"></span>

						<span class="btn btn-danger"></span>
					</div>
				</div>
				<!-- /.sidebar-shortcuts -->

				<ul class="nav nav-list">
					<li class="">
						<a href="/views/index.html">
							<i class="menu-icon fa fa-tachometer"></i>
							<span class="menu-text"> 我的首页 </span>
						</a>

						<b class="arrow"></b>
					</li>

					<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-tasks"></i>
							<span class="menu-text"> 数据管理 </span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">

							<li class="">
								<a href="/views/dataManage/studentManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 学生
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/teacherManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 教师
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/majorManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 专业
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/classroomManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 班级
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/scoreManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 成绩
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/certificateManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 证书
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/competitionManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 竞赛
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/innovationTrainManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 创新训练
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/scholarshipManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 奖学金
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/excellentStudentManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 优秀学生
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/pushExcellentManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 推优
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/partyMemberManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 入党
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/postGraduateManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 考研录取
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/volunteerManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 志愿服务
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/dutyManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 学生干部
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/dataManage/adviceManage.html">
									<i class="menu-icon fa fa-caret-right"></i> 发展建议
								</a>

								<b class="arrow"></b>
							</li>

						</ul>
					</li>

					<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-bar-chart-o"></i>
							<span class="menu-text"> 数据分析 </span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">
							<li class="">
								<a href="#" class="dropdown-toggle">
									<i class="menu-icon fa fa-caret-right"></i> 个人情况分析
									<b class="arrow fa fa-angle-down"></b>
								</a>

								<b class="arrow"></b>

								<ul class="submenu">
									<li class="">
										<a href="/views/dataAnalysis/student/personalGrade.html">
											<i class="menu-icon fa fa-leaf green"></i>个人成绩查询
										</a>

										<b class="arrow"></b>
									</li>
									<li class="">
										<a href="/views/dataAnalysis/student/personalAllInfo.html">
											<i class="menu-icon fa fa-leaf green"></i>发展综合分析
										</a>

										<b class="arrow"></b>
									</li>

								</ul>
							</li>

							<li class="">
								<a href="/views/dataAnalysis/dorm/dormAtmosphere.html">
									<i class="menu-icon fa fa-caret-right"></i> 宿舍情况分析
								</a>

								<b class="arrow"></b>
							</li>

							<li class="">
								<a href="/views/dataAnalysis/classroom/classAtmosphere.html">
									<i class="menu-icon fa fa-caret-right"></i> 班级情况分析
								</a>

								<b class="arrow"></b>
							</li>

							<li class="">
								<a href="#" class="dropdown-toggle">
									<i class="menu-icon fa fa-caret-right"></i> 整体学业分析
									<b class="arrow fa fa-angle-down"></b>
								</a>

								<b class="arrow"></b>

								<ul class="submenu">
									<li class="">
										<a href="/views/dataAnalysis/all/allGrade.html">
											<i class="menu-icon fa fa-leaf green"></i>学分积欠情况分析
										</a>

										<b class="arrow"></b>
									</li>
									<li class="">
										<a href="/views/dataAnalysis/all/make_up_rebuild.html">
											<i class="menu-icon fa fa-leaf green"></i>补考重修情况分析
										</a>

										<b class="arrow"></b>
									</li>

								</ul>
							</li>

						</ul>
					</li>

					<li class="active open">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-book"></i>
							<span class="menu-text"> 数据预测 </span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">
							<li class="active">
								<a href="/views/bigDataAnalysis/courseDependence.html">
									<i class="menu-icon fa fa-caret-right"></i> 课程通过预警
								</a>

								<b class="arrow"></b>
							</li>

							<li class="">
								<a href="/views/bigDataAnalysis/scorePosition.html">
									<i class="menu-icon fa fa-caret-right"></i> 成绩位置预测
								</a>

								<b class="arrow"></b>
							</li>

							<li class="">
								<a href="/views/bigDataAnalysis/postGraduate.html">
									<i class="menu-icon fa fa-caret-right"></i> 考研录取预测
								</a>

								<b class="arrow"></b>
							</li>

							<li class="">
								<a href="/views/bigDataAnalysis/partyMember.html">
									<i class="menu-icon fa fa-caret-right"></i> 入党情况预测
								</a>

								<b class="arrow"></b>
							</li>

						</ul>
					</li>

					<li class="">
						<a href="#" class="dropdown-toggle">
							<i class="menu-icon fa fa-folder-open-o"></i>
							<span class="menu-text"> 文件操作 </span>

							<b class="arrow fa fa-angle-down"></b>
						</a>

						<b class="arrow"></b>

						<ul class="submenu">
							<li class="">
								<a href="/views/file/fileUpload.html">
									<i class="menu-icon fa fa-caret-right"></i> 文件上传
								</a>

								<b class="arrow"></b>
							</li>
							<li class="">
								<a href="/views/file/fileDownload.html">
									<i class="menu-icon fa fa-caret-right"></i> 文件下载
								</a>

								<b class="arrow"></b>
							</li>

						</ul>
					</li>

				</ul>
				<!-- /.nav-list -->
				<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
					<i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
				</div>
			</div>

			<div class="main-content">
				<div class="main-content-inner">
					<div class="breadcrumbs ace-save-state" id="breadcrumbs">
						<ul class="breadcrumb">
							<li>
								<i class="ace-icon fa fa-home home-icon"></i>
								<a href="/views/index.html">首页</a>
							</li>

							<li class="active">课程通过预警</li>
						</ul>
						<!-- /.breadcrumb -->

					</div>

					<div class="page-content">

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="row">
									<div class="col-sm-10">
										<h3 class="header blue lighter smaller">
											<i class="ace-icon fa fa-spinner"></i>
											课程通过预警
										</h3>
									</div>
								</div>
								<div class="row">
									<div class="col-sm-2">
										<center>
											<label for="st_grade">选择年级 : </label>
											<select name="st_grade" id="st_grade" style="width: 120px;margin-left: 5px;">
												<!--<option selected="selected" value=""></option>
												<option value="2014">2014</option>
												<option value="2015">2015</option>
												<option value="2016">2016</option>
												<option value="2017">2017</option>
												<option value="2018">2018</option>
												<option value="2019"></option>-->
											</select>
										</center>
									</div>
									<div class="col-sm-2">
										<center>
											<label for="st_major">选择专业 : </label>

											<select name="st_major" id="st_major" style="width: 120px;margin-left: 5px;">
												<!--<option selected="selected" value=""></option>
												<option value="2014">计算机嵌入式</option>
												<option value="2015">2015</option>
												<option value="2016">2016</option>
												<option value="2017">2017</option>
												<option value="2018">2018</option>-->
											</select>
										</center>
									</div>

									<div class="col-sm-2">
										<center>
											<label for="st_class">选择班级 : </label>

											<select name="st_class" id="st_class" style="width: 120px;margin-left: 5px;">
												<!--<option selected="selected" value=""></option>
												<option value="2014">嵌入式1511</option>
												<option value="2015">2015</option>
												<option value="2016">2016</option>
												<option value="2017">2017</option>
												<option value="2018">2018</option>-->
											</select>
										</center>
									</div>

									<div class="col-sm-2">
										<center>
											<label for="st_name">选择姓名 : </label>

											<select name="st_name" id="st_name" style="width: 120px;margin-left: 5px;">
											</select>
										</center>

									</div>
									<div class="col-sm-2">
										<center>
											<button id="query" class="btn btn-info btn-sm">
										<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
									&nbsp;查&nbsp;找&nbsp;
									  </button>
										</center>
									</div>
								</div>

								<div class="row">
									<div class="col-sm-10">
										<h3 class="header blue lighter smaller">
										</h3>
									</div>
								</div>

								<div class="row">
									<!--课程依赖图-->
									<div class="col-sm-12">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter">
													<i class="ace-icon fa fa-star orange"></i>
													课程依赖图
												</h4>

												<div class="widget-toolbar">
													<a href="#" data-action="collapse">
														<i class="ace-icon fa fa-chevron-up"></i>
													</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<!--课程依赖图-->
													<div id="course_dependence" style="width: 700px;height:400px;"></div>
												</div>
												<!-- /.widget-main -->
											</div>
											<!-- /.widget-body -->
										</div>
										<!-- /.widget-box -->
									</div>
									<!-- /.col -->

								</div>
								<!-- /.row -->

								<div class="row">
									<div class="col-sm-12">
										<h3 class="header blue lighter smaller">
										</h3>
									</div>
								</div>

								<div class="row">
									<!--必修课未通过情况-->
									<div class="col-sm-6">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter">
													<i class="ace-icon fa fa-star orange"></i>
													必修课未通过情况
												</h4>

												<div class="widget-toolbar">
													<a href="#" data-action="collapse">
														<i class="ace-icon fa fa-chevron-up"></i>
													</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<table class="table table-bordered table-striped table-hover tablesorter tablesorter-blue" style="margin-top: 10px;" id="course_fail">
														<thead class="thin-border-bottom" style="visibility: hidden;" id="course_fail_title">
															<tr>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">学年</font>
																</th>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">学期</font>
																</th>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">课程名</font>
																</th>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">成绩</font>
																</th>

															</tr>
														</thead>
														<tbody id="course_fail_tbody"></tbody>
													</table>
												</div>
												<!-- /.widget-main -->
											</div>
											<!-- /.widget-body -->
										</div>
										<!-- /.widget-box -->
									</div>

									<div class="col-sm-6">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter">
													<i class="ace-icon fa fa-star orange"></i>
													必修课挂科预警
												</h4>

												<div class="widget-toolbar">
													<a href="#" data-action="collapse">
														<i class="ace-icon fa fa-chevron-up"></i>
													</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<table class="table table-bordered table-striped table-hover" style="margin-top: 10px;" id="course_warn">
														<thead class="thin-border-bottom" style="visibility: hidden;" id="course_warn_title">
															<tr>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">课程名</font>
																</th>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">学分</font>
																</th>
																<th>
																	<i class="ace-icon fa fa-caret-right blue"></i>
																	<font size="4">预警级别</font>
																</th>

															</tr>
														</thead>
														<tbody id="course_warn_tbody"></tbody>
													</table>
												</div>
												<!-- /.widget-main -->
											</div>
											<!-- /.widget-body -->
										</div>
										<!-- /.widget-box -->
									</div>

								</div>

							</div>

							<!-- PAGE CONTENT ENDS -->

						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
			</div>
			<!-- /.main-content -->

			<div class="footer">
				<div class="footer-inner">
					<div class="footer-content">
						<span class="bigger-120">
							<span class="blue bolder" style="margin-right: 10px;">学生发展数据综合评价与分析系统</span> 苏州科技大学 &copy; 2018-2019
						</span>

					</div>
				</div>
			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div>
		<!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="/assets/js/jquery-2.1.4.min.js"></script>
		<script src="/assets/js/jquery.form.js"></script>
		<script src="/assets/js/jquery.cookie.js"></script>
		<script src="/assets/js/sddb.util.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="/assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
		</script>
		<script src="/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->
		<script src="/assets/js/jquery-ui.min.js"></script>
		<script src="/assets/js/jquery.ui.touch-punch.min.js"></script>

		<!-- ace scripts -->
		<script src="/assets/js/ace-elements.min.js"></script>
		<script src="/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->

		<!-- ECharts单文件引入 -->
		<!-- 标签式单文件引入 -->
		<script src="/assets/js/echarts-3.0.js"></script>

		<!--选择学生-->
		<script type="text/javascript">
			//总体数据
			var arrayGrade = [];

			//判断数组中是否存在此数
			function isExist(array, n) {
				for(var i = 0; i < array.length; i++) {
					if(array[i] == n) {
						return true;
					}
				}
				return false;

			}
			//先得到年级
			function getGrade(arrayGrade) {

				var grade = [" "];
				for(var i = 0; i < arrayGrade.length; i++) {
					//先判断grade中是否存在该数字
					var grade_item = arrayGrade[i].cl_grade;
					if(!isExist(grade, grade_item)) {
						grade.push(grade_item);
					}
				}
				//遍历grade数组，将值填入进年级下拉框中
				var sel_grade = document.getElementById("st_grade");
				for(var j = 0; j < grade.length; j++) {
					var temp = grade[j];
					sel_grade.options[j] = new Option(temp, temp);
				}
			}

			//st_grade的改变事件
			$("#st_grade").change(function() {
				var major = [" "];
				var grade = $("#st_grade option:selected").val();

				//取出指定年级的不重复的专业
				for(var i = 0; i < arrayGrade.length; i++) {
					var temp_grade = arrayGrade[i].cl_grade;
					var temp_major = arrayGrade[i].cl_major;

					if((temp_grade == grade) && (!isExist(major, temp_major))) {
						major.push(temp_major);
					}
				}

				var sel_major = document.getElementById("st_major");
				//清空之前的专业下拉框与班级下拉框、学生姓名下拉框
				$("#st_major").empty();
				$("#st_class").empty();
				$("#st_name").empty();

				for(var j = 0; j < major.length; j++) {
					sel_major.options[j] = new Option(major[j], major[j]);
				}
			});

			//st_major的改变事件

			$("#st_major").change(function() {

				var sclass = [" "];
				var grade = $("#st_grade option:selected").val();
				var major = $("#st_major option:selected").val();

				//取出指定年级、专业的班级
				for(var i = 0; i < arrayGrade.length; i++) {
					var temp_grade = arrayGrade[i].cl_grade;
					var temp_major = arrayGrade[i].cl_major;
					if((temp_grade == grade) && (temp_major == major)) {
						sclass.push(arrayGrade[i].cl_name);
					}
				}

				///清空之前的班级下拉框
				$("#st_class").empty();
				$("#st_name").empty();

				var sel_class = document.getElementById("st_class");
				for(var j = 0; j < sclass.length; j++) {
					sel_class.options[j] = new Option(sclass[j], sclass[j]);
				}
			})

			//st_class的改变事件，需要使用ajax来获取班级学生
			$("#st_class").change(function() {
				//清空学生
				$("#st_name").empty();
				var sclass = $("#st_class option:selected").val();
				if(sclass == " ") {
					return;
				}
				//使用ajax来获取学生
				$.ajax({
					type: "post",
					url: "/student/findStuByClass.do",
					dataType: 'json',
					data: {
						st_class: sclass
					},
					success: function(data) {
						var stu = document.getElementById("st_name");
						for(var i = 0; i < data.length; i++) {
							stu.options[i] = new Option(data[i].st_name, data[i].st_id);
						}
					},
					error: function(err) {
						alert("获取学生发生错误！");
					}
				});
			})

			$(function() {
				//ajax请求获取班级
				$.ajax({
					type: "post",
					url: "/score/getClassroom.do",
					dataType: "json",
					data: {},
					success: function(data) {
						arrayGrade = data;
						getGrade(data);

					},
					error: function() {
						alert("获取班级信息失败!");
					}
				});
			})
		</script>

		<!--依赖图的配置-->
		<script>
			function getCourseDependence(name) {

				// 基于准备好的dom，初始化echarts实例
				var myChart = echarts.init(document.getElementById('course_dependence'));
				myChart.showLoading();
				$.getJSON('/assets/json/' + name, function(json) {
					myChart.hideLoading();
					myChart.setOption(option = {

						animationDurationUpdate: 1500,
						animationEasingUpdate: 'quinticInOut',
						series: [{
							type: 'graph',
							layout: 'force',
							draggable: true,
							force: {
								//线的长度
								repulsion: 400
							},
							data: json.nodes.map(function(node) {
								return {
									id: node.id,
									name: node.label,
									symbolSize: 18,
									itemStyle: {
										normal: {
											color: node.color
										}
									}
								};
							}),
							edges: json.edges.map(function(edge) {
								return {
									source: edge.sourceID,
									target: edge.targetID
								};
							}),
							label: {
								emphasis: {
									position: 'right',
									show: true
								},
								normal: {
									position: 'right',
									show: true
								}
							},
							roam: true,
							edgeSymbol: ['circular', 'arrow'],
							//箭头大小
							edgeSymbolSize: [2, 8],
							focusNodeAdjacency: true,
							lineStyle: {
								normal: {
									//线的宽度
									width: 1,
									//线的完全度
									curveness: 0.3,
									//线的不透明度
									opacity: 1
								}
							}
						}]
					}, true);
				});
			}
		</script>

		<!--获取未通过的课程与预警课程-->
		<script>
			function getFailAndWarn(name) {

				//清空之前的行
				$("#course_fail tbody").html("");
				$("#course_warn tbody").html("");

				//先从json文件中载入json对象
				$.getJSON('/assets/json/' + name, function(json) {
					//将学号塞入json中
					var d = new Object();
					d.dependence = json;
					d.sc_student_id = $("#st_name").val();
					//再发送请求
					$.ajax({
						type: "post",
						url: "/forecast/getFailAndWarn",
						dataType: "json",
						contentType: "application/json",
						data: JSON.stringify(d),
						success: function(data) {

							//----------------未通过必修课程板块开始------------------------------------------
							var table = document.getElementById("course_fail");
							var t_body = document.getElementById("course_fail_tbody");

							//该生无挂科时
							if(data.fail == null || data.fail.length == 0) {
								var tr = document.createElement("tr");
								var td = document.createElement("td");
								td.innerHTML = "<font size='3' color='#000000'>" + "该生无核心必修课挂科" + "<i class='glyphicon glyphicon-thumbs-up orange bigger-120' style='vertical-align:middle;margin-left:5px'></i>" + "</font>";
								tr.appendChild(td);
								t_body.appendChild(tr);
							} else {
								for(var i = 0; i < data.fail.length; i++) {
									var t_tr = document.createElement("tr");
									var td_sc_edu_year = document.createElement("td");
									var td_sc_edu_term = document.createElement("td");
									var td_sc_course_name = document.createElement("td");
									var td_sc_score = document.createElement("td");

									td_sc_edu_year.innerHTML = "<font size='3' color='#000000'>" + data.fail[i].sc_edu_year + "</font>";
									td_sc_edu_term.innerHTML = "<font size='3' color='#000000'>" + data.fail[i].sc_edu_term + "</font>";
									td_sc_course_name.innerHTML = "<font size='3' color='#000000'>" + data.fail[i].sc_course_name + "</font>";
									td_sc_score.innerHTML = "<font size='3' color='#000000'>" + data.fail[i].sc_score + "</font>";

									t_tr.appendChild(td_sc_edu_year);
									t_tr.appendChild(td_sc_edu_term);
									t_tr.appendChild(td_sc_course_name);
									t_tr.appendChild(td_sc_score);

									t_body.appendChild(t_tr);
								}
							}
							table.appendChild(t_body);

							document.getElementById("course_fail_title").style.visibility = "visible";

							//----------------未通过必修课程板块结束------------------------------------------
							var w_table = document.getElementById("course_warn");
							var w_t_body = document.getElementById("course_warn_tbody");

							//该生无挂科时
							if(data.warn == null || data.warn.length == 0) {
								var w_tr = document.createElement("tr");
								var w_td = document.createElement("td");
								w_td.innerHTML = "<font size='3' color='#000000'>" + "无挂科预警" + "<i class='glyphicon glyphicon-thumbs-up orange bigger-120' style='vertical-align:middle;margin-left:5px'></i>" + "</font>";
								w_tr.appendChild(w_td);
								w_t_body.appendChild(w_tr);
							} else {
								for(var i = 0; i < data.warn.length; i++) {
									var w_t_tr = document.createElement("tr");
									var w_td_sc_course_name = document.createElement("td");
									var w_td_sc_course_credit = document.createElement("td");
									var w_td_level = document.createElement("td");

									w_td_sc_course_name.innerHTML = "<font size='3' color='#000000'>" + data.warn[i].sc_course_name + "</font>";
									w_td_sc_course_credit.innerHTML = "<font size='3' color='#000000'>" + data.warn[i].sc_course_credit + "</font>";
									w_td_level.innerHTML = "<font size='3' color='#000000'>" + data.warn[i].level + "</font>";

									w_t_tr.appendChild(w_td_sc_course_name);
									w_t_tr.appendChild(w_td_sc_course_credit);
									w_t_tr.appendChild(w_td_level);

									w_t_body.appendChild(w_t_tr);
								}
							}
							w_table.appendChild(w_t_body);

							document.getElementById("course_warn_title").style.visibility = "visible";

						},
						error: function(err) {

						}
					});
				});
			}
		</script>

		<script>
			$("#query").click(function() {
				if($("#st_name").val() == null) {
					alert("请选择某一个学生!");
					return;
				}

				//将专业名传入
				var name = $("#st_major").val();
				getCourseDependence(getMajorEng(name) + ".json");
				getFailAndWarn(getMajorEng(name) + ".json");
			});
		</script>

	</body>

</html>